package homework;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String input = in.nextLine();
            String output = in.nextLine();
            Object[] badKeys = findBadKeys(input, output).toArray();
            for(int i = 0; i < badKeys.length; i++){
                System.out.print(badKeys[i]);
            }
        }
    }


    private static Set<Character> findBadKeys(String input, String output){
        input = input.toUpperCase();
        output = output.toUpperCase();
        Set<Character> set = new HashSet<>();
        for(int i = 0; i < output.length(); i++){
            Character ch = output.charAt(i);
            set.add(ch);
        }
        Set<Character> badKeys = new HashSet<>();
        for(int i = 0; i < input.length(); i++){
            Character ch = input.charAt(i);
            if(!set.contains(ch)){
                badKeys.add(ch);
            }
        }
        return badKeys;
    }
}
